The volume mirror commands enable you to perform the following tasks:
The volume mirror new command creates a mirror. When creating a mirror, you specify a virtual server, a source volume, the name of the mirror, the aggregate on which the mirror is to be located, and the mirror's type (LS or DR). You can optionally specify a schedule on which the mirror is automatically replicated (see Chapter 13, Managing Jobs and Schedules for information on creating schedules), whether to replicate the mirror immediately upon creation, and a comment for the mirror.
The following example creates a DR mirror named dept_eng_dr_mirror of a source volume named dept_eng. The volume and mirror are located on a virtual server named vs0. The mirror is located on an aggregate named aggr3. The mirror is replicated according to a schedule named halfhour and is replicated upon creation.
node::>volume mirror new -vserver vs0 -source dept_eng -mirror dept_eng_dr_mirror -aggregate aggr3 -type DR -schedule halfhour -replicate-now true
If you create an LS mirror of a read-write volume that does not have any other LS mirrors, client requests are automatically directed to the LS mirror or mirrors, and client write requests to the volume fail with the error message read-only filesystem. If a client requires read-write access to the parent read-write volume, it must mount the volume through the .admin link at the root of the virtual server (/.admin), as described in “Mirror”.
You can use the volume mirror modify command to modify a mirror's type, replication schedule, or comment. The following example modifies the mirror created in the previous example to replicate according to a schedule named 2hrs.
node::>volume mirror modify -vserver vs0 -source dept_eng -mirror dept_eng_dr_mirror -schedule 2hrs
To display information about mirrors, use the volume mirror show command. By default, the command displays the following information about all mirrors:
Virtual server name
Source volume name
Mirror name
Mirror type (LS for load sharing or DR for disaster recovery)
Replication status
Other information is displayed in a detailed view and if other parameters are specified. See the reference page for the command for details.
The following example displays information about all mirrors of a source volume named src_ui.
node::>volume mirror show -source src_uiVserver Source Mirror Type Replicated At (state) -------------------------------------------------------------------------- vs0 src_ui src_ui_ls_mir1 LS replicated vs0 src_ui src_ui_ls_mir2 LS replicating vs0 src_ui src_ui_dr_mir DR replicated
If you do not replicate a mirror upon its creation, or if you want to replicate a mirror before its next scheduled replication, use the volume mirror replicate command to manually replicate the mirror. You can optionally specify whether the replication job runs in the foreground; running the job in the foreground means the job completes more quickly, but possibly at the expense of other operations on the Data ONTAP 10.0 system. The following example replicates a mirror named src_ui_dr_mir. The mirror is of a source volume named src_ui on a virtual server named vs0. The replication job runs in the foreground.
node::>volume mirror replicate -vserver vs0 -source src_ui -mirror src_ui_dr_mir -foreground true
You can schedule automatic mirror replications by creating a schedule and associating the mirror with the schedule. See Chapter 13, Managing Jobs and Schedules for information on creating schedules. To associate a mirror with a schedule, use the -schedule parameter with the volume mirror new or volume mirror modify command, as described in the preceding sections.
If a source volume fails, you can promote one of its mirrors to take its place. The promoted mirror has the same attributes as its source mirror. To promote a mirror, use the volume mirror promote command. Because promoting mirrors is an infrequent operation used only to recover from volume failures or losses, the command can be run only at the advanced privilege level and higher. When you promote a mirror, you can optionally specify whether to delete the source volume, if it still exists.
The following example promotes a mirror named src_ui_dr_mir to replace its source volume, which is named src_ui, on a virtual server named vs0. The example deletes the source volume.
node::>set -priv advancednode:*>volume mirror promote -vserver vs0 -source src_ui -mirror src_ui_dr_mir -delete-readwrite true
To delete a mirror, use the volume mirror delete command. The command deletes the specifies mirror but leaves the source volume intact.
If you have a volume that is mirrored to two aggregates and you want to delete one of the mirrors, ensure that all mirrors are replicated immediately before deleting any mirrors, or otherwise ensure that all mirrors are synchronized with the source volume before deleting any mirrors. This prevents clients from receiving potentially out-of-date data from an obsolete mirror.
The following example deletes a mirror named src_ui_ls_mir2. The mirror is of a source volume named src_ui on a virtual server named vs0.
node::>volume mirror delete -vserver vs0 -source src_ui -mirror src_ui_ls_mir2